An operating system is associated with an attack surface—a sum of different points where an unauthorized user (“attacker”) can try to enter data to or extract data from the operating system. CPU virtualization has been used to reduce the attack surface. But, using CPU virtualization to reduce the attack surface requires expensive virtual machine (VM) context switches through VM operations including VM exit, VM context switch, and VM resume. These VM operations are associated with expensive overheads. As the granularity of code becomes finer, frequent context switches to reduce the attack surface of an operating system become the bottleneck to high performance computing.